﻿using FlyingHat.Extensions.Redis;
using Microsoft.AspNetCore.Mvc;

namespace FlyingHat.Web.Controllers
{
    public class HomeController : BaseController
    {
        private readonly ILogger<HomeController> _logger;
        private readonly IRedisHelper redisHelper;
        public HomeController(ILogger<HomeController> logger, IRedisHelper redisHelper)
        {
            _logger = logger;
            this.redisHelper = redisHelper;
        }

        public IActionResult Index()
        {

            return View();
        }
        //public FileResult GetImg()
        //{
        //    // 以字节数组的方式存储，以字节数组的方式读取返回
        //    var img = @"D:\图片\gaitubao_526423_png.png";
        //    var file = System.IO.File.ReadAllBytes(img);
        //    redisHelper.Set("imgkey", file);
        //    var aa = redisHelper.Get<byte[]>("imgkey");
        //    return File(aa, "image/png");
        //}
    }
}